var express = require('express');
var router = express.Router();
var mysql = require('../common/mysql');

/* GET home page. */
router.get('/', function (req, res, next) {
  console.log('目前访问页面:', req.session.views);
  mysql.query('SELECT id,`merchant_code`,`mobile`,`username` FROM `t_card_user` LIMIT 0,10', function (err, results, fields) {
    if (err) throw err;
    console.log('The solution is: ', JSON.stringify(results));
  });
  res.render('index', {title: 'Express'});
});

module.exports = router;
